package com.hrm.mapper;

import com.hrm.pojo.Document;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DocumentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Document record);

    /*添加文档*/
    int insertSelective(Document record);

    Document selectByPrimaryKey(Integer id);


    /*跟新文档*/
    int updateByPrimaryKeySelective(Document record);

    int updateByPrimaryKey(Document record);


    /**
     * 分页查询
     * @param Title 标题
     * @return
     * @throws SQLException
     */
    List<Document> selectDocumentByTitle(@Param("title") String Title) throws SQLException;

    /**
     * 查询文件是否存在
     * @param userId 用户ID
     * @return
     * @throws SQLException
     */
    Document selectDocumentByUserIdAndFileName(@Param("userId") String userId,@Param("filename") String filename) throws SQLException;


}